#
# Created by gmakemake (Sparc Sep  3 2010) on Mon Sep 13 01:13:05 2010
#

#
# Definitions
#

.SUFFIXES:
.SUFFIXES:	.a .o .c .C .cpp .s
.c.o:
		$(COMPILE.c) $<
.C.o:
		$(COMPILE.cc) $<
.cpp.o:
		$(COMPILE.cc) $<
.s.o:
		$(COMPILE.cc) $<
.c.a:
		$(COMPILE.c) -o $% $<
		$(AR) $(ARFLAGS) $@ $%
		$(RM) $%
.C.a:
		$(COMPILE.cc) -o $% $<
		$(AR) $(ARFLAGS) $@ $%
		$(RM) $%
.cpp.a:
		$(COMPILE.cc) -o $% $<
		$(AR) $(ARFLAGS) $@ $%
		$(RM) $%

CC =		gcc
CXX =		g++

RM = rm -f
AR = ar
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c

########## Flags from header.mak

WARNING_FLAGS= -Wall -Wextra -Wconversion -Wcast-qual -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wstrict-overflow=5 -Wwrite-strings 
CXXFLAGS= $(WARNING_FLAGS) -ggdb 

########## End of flags from header.mak


CPP_FILES =	Borda.cpp CondorcetElection.cpp CopelandElection.cpp Countdown.cpp ElectionBase.cpp ElectionCreator.cpp ElectionRegistry.cpp IrrationalElection.cpp IrrationalVote.cpp Plurality.cpp PositionalScoreElection.cpp RationalElection.cpp RationalVote.cpp ScoringVector.cpp Veto.cpp Vote.cpp frontend.cpp functions.cpp
C_FILES =	
S_FILES =	
H_FILES =	Borda.h CondorcetElection.h CopelandElection.h Countdown.h Creator.h Election.h ElectionBase.h ElectionCreator.h ElectionRegistry.h IrrationalElection.h IrrationalVote.h Plurality.h PositionalScoreElection.h RationalElection.h RationalVote.h ScoringVector.h Veto.h Vote.h VotingSystems.h frontend.h functions.h
SOURCEFILES =	$(H_FILES) $(CPP_FILES) $(C_FILES) $(S_FILES)
.PRECIOUS:	$(SOURCEFILES)
OBJFILES =	Borda.o CondorcetElection.o CopelandElection.o Countdown.o ElectionBase.o ElectionCreator.o ElectionRegistry.o IrrationalElection.o IrrationalVote.o Plurality.o PositionalScoreElection.o RationalElection.o RationalVote.o ScoringVector.o Veto.o Vote.o functions.o 

#
# Main targets
#

all:	frontend 

frontend:	frontend.o $(OBJFILES)
	$(CXX) $(CXXFLAGS) -o frontend frontend.o $(OBJFILES) $(CCLIBFLAGS)

#
# Dependencies
#

Borda.o:	Borda.h Election.h ElectionBase.h IrrationalVote.h PositionalScoreElection.h RationalElection.h RationalVote.h Vote.h
CondorcetElection.o:	CondorcetElection.h Election.h ElectionBase.h IrrationalVote.h RationalElection.h RationalVote.h Vote.h
CopelandElection.o:	CopelandElection.h Election.h ElectionBase.h IrrationalElection.h IrrationalVote.h RationalVote.h Vote.h
Countdown.o:	Countdown.h Election.h ElectionBase.h IrrationalVote.h PositionalScoreElection.h RationalElection.h RationalVote.h Vote.h
ElectionBase.o:	ElectionBase.h
ElectionCreator.o:	ElectionBase.h ElectionCreator.h
ElectionRegistry.o:	ElectionBase.h ElectionCreator.h ElectionRegistry.h functions.h
IrrationalElection.o:	Election.h ElectionBase.h IrrationalElection.h IrrationalVote.h RationalVote.h Vote.h
IrrationalVote.o:	IrrationalVote.h RationalVote.h Vote.h
Plurality.o:	Election.h ElectionBase.h IrrationalVote.h Plurality.h PositionalScoreElection.h RationalElection.h RationalVote.h Vote.h
PositionalScoreElection.o:	Election.h ElectionBase.h IrrationalVote.h PositionalScoreElection.h RationalElection.h RationalVote.h Vote.h
RationalElection.o:	Election.h ElectionBase.h IrrationalVote.h RationalElection.h RationalVote.h Vote.h
RationalVote.o:	IrrationalVote.h RationalVote.h Vote.h
ScoringVector.o:	Election.h ElectionBase.h IrrationalVote.h PositionalScoreElection.h RationalElection.h RationalVote.h ScoringVector.h Vote.h
Veto.o:	Election.h ElectionBase.h IrrationalVote.h PositionalScoreElection.h RationalElection.h RationalVote.h Veto.h Vote.h
Vote.o:	Vote.h
frontend.o:	Borda.h CondorcetElection.h CopelandElection.h Countdown.h Creator.h Election.h ElectionBase.h ElectionCreator.h ElectionRegistry.h IrrationalElection.h IrrationalVote.h Plurality.h PositionalScoreElection.h RationalElection.h RationalVote.h ScoringVector.h Veto.h Vote.h VotingSystems.h frontend.h functions.h
functions.o:	functions.h

#
# Housekeeping
#

Archive:	archive.tgz

archive.tgz:	$(SOURCEFILES) Makefile
	tar cf - $(SOURCEFILES) Makefile | gzip > archive.tgz

clean:
	-/bin/rm $(OBJFILES) frontend.o core 2> /dev/null

realclean:        clean
	-/bin/rm -rf frontend 
